#ifndef VROUTE_ROUTE_LIST_DATA_HPP_3
#define VROUTE_ROUTE_LIST_DATA_HPP_3

#include "vroute_sys.hpp"
#include "vroute_stack.hpp"
#include "vroute_IFServerdef.hpp"

namespace vroute_stack
{
    typedef struct _routeTableInfo
    {
        NodeAddr dst;
        nodeAddrType addrtype;
        unsigned char statu;
        unsigned char reversed;
        unsigned char len;
        unsigned char addrs[max_node_count * size_nodeType_value];
    }routeTableInfo;

    class routeTableListMgr
    {
    public:
        static routeTableListMgr* getInstance();
        static void releaseInstance();

        int Init(SystemStartType type);   

        int setKV(const NodeAddr& dst, routeTableItemKey key, const void* value);
        int getKV(const NodeAddr& dst, routeTableItemKey key, void*& value);
        int addRouteRecord(const Node& dst, char* addrs, int addrLen, routeTable_item_statu statu);
        int getRoute(Node& dst, char*& addrstart, int& addrlen);
        void DelRoute(Node& dst);
    private:
        routeTableListMgr();
        ~routeTableListMgr();
        
    private:
        static routeTableListMgr* _instance;
        vos_criticalSection m_cs_route;
        routeTableInfo* m_table_list;
    };
}
#endif //VROUTE_ROUTE_LIST_DATA_HPP_3